/*
 * @Author: 晟松
 * @Date: 2021-11-29 23:55:45
 * @LastEditors: 晟松
 * @LastEditTime: 2021-12-07 11:14:32
 * @FilePath: \mini-vue3d:\Code\node\koa2\volunteer-service\src\main\router.js
 * @Description: 
 */
// src/main/router.js
import requireDirectory from 'require-directory';
import Router from 'koa-router';
import { ENUM } from 'sequelize/dist';

export default app => {
  requireDirectory(module, './controller', {
    visit: (obj) => {
      if (obj.default instanceof Router) {
        app.use(obj.default.routes()).use(obj.default.allowedMethods());
      }
    }
  })
}

